package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.pojo.vo.Result;
import com.dingwen.treasure.business.service.CompletableFutureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 　CompletableFutureController
 * 　@author dingwen
 * 　@date 2022/8/3
 */
@Api(tags = "多线程异步任务事务控制API")
@RestController
@Slf4j
@RequestMapping("/future/acid")
public class CompletableFutureController implements BaseViewController {


    /**
     * completableFutureService
     */
    @Resource
    private CompletableFutureService completableFutureService;

    @ApiOperation(value = "测试", response = Result.class)
    @GetMapping
    public void test() {
        completableFutureService.testAcid();
    }
}
